package com.lm.antlr4.controller;

import com.lm.antlr4.service.ExprService;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/expr")
public class ExprController {

    private final ExprService exprService;

    public ExprController(ExprService exprService) {
        this.exprService = exprService;
    }

    @GetMapping("/parse")
    public String parse(@RequestParam String input) {
        return exprService.parseExpression(input);
    }
}
